package com.nf.web;

import java.io.IOException;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.nf.service.ProductServiceImpl;
@WebServlet("/product/delete")
public class ProductDeleteServlet extends HttpServlet{

	@Override
	protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String no=req.getParameter("id").trim();
		
		ProductServiceImpl productService=new ProductServiceImpl();
		Object result=null;
		try {
			result = productService.deleteByNo(no);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		resp.setContentType("spplication/json;charset=UTF-8");
		resp.getWriter().println(result);
	}

}
